cmake_minimum_required(VERSION 3.5)
project(wit_wtgahrs1_ros2_driver)

# Default to C99
if(NOT CMAKE_C_STANDARD)
  set(CMAKE_C_STANDARD 99)
endif()

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  # add_compile_options(-Wall -Wextra -Wpedantic)
  add_compile_options(-Wall -Wextra)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)

# Bin and Install
include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}/include
)

file(GLOB  SRC_C ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c)
file(GLOB  SRC_CPP ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)

add_executable(${PROJECT_NAME}_node  
  ${SRC_C}
  ${SRC_CPP} 
)
ament_target_dependencies(${PROJECT_NAME}_node rclcpp sensor_msgs)
target_link_libraries(${PROJECT_NAME}_node pthread)

# Install
install(TARGETS ${PROJECT_NAME}_node
  DESTINATION lib/${PROJECT_NAME}
)

# install(DIRECTORY launch
#   DESTINATION share/${PROJECT_NAME}/
# )

ament_package()
